package com.kkb.pojo;

import com.github.pagehelper.PageInfo;

import java.util.List;

public class TeamAndPageInfo<T> {

    private Integer status;  //状态码
    private Integer code;  //返回页面状态码
    private String msg;  //用户提示信息
    private PageInfo<T> pageInfo;  //返回分页对象
    private List<T> list;  //返回集合
    private T obj;  //返回单个对象

    //初始化对象属性
    public TeamAndPageInfo() {
        this.status = 1;  //默认成功
        this.code = 200;  //默认返回200状态码
        this.msg = "OK";  //提示信息默认为OK
        this.pageInfo = null;
        this.list = null;
        this.obj = null;
    }

    public TeamAndPageInfo(PageInfo<T> pageInfo) {
        this.pageInfo = pageInfo;
    }

    public TeamAndPageInfo(List<T> list) {
        this.list = list;
    }

    public TeamAndPageInfo(T obj) {
        this.obj = obj;
    }

    public TeamAndPageInfo(Integer status, Integer code, String msg) {
        this.status = status;
        this.code = code;
        this.msg = msg;
    }

    public TeamAndPageInfo(Integer status, Integer code, String msg, List<T> list) {
        this.status = status;
        this.code = code;
        this.msg = msg;
        this.list = list;
    }

    public TeamAndPageInfo(Integer status, Integer code, String msg, PageInfo<T> pageInfo, List<T> list) {
        this.status = status;
        this.code = code;
        this.msg = msg;
        this.pageInfo = pageInfo;
        this.list = list;
    }

    public TeamAndPageInfo(Integer status, Integer code, String msg, T obj) {
        this.status = status;
        this.code = code;
        this.msg = msg;
        this.obj = obj;
    }

    @Override
    public String toString() {
        return "TeamAndPageInfo{" +
                "status=" + status +
                ", code=" + code +
                ", msg='" + msg + '\'' +
                ", pageInfo=" + pageInfo +
                ", list=" + list +
                ", obj=" + obj +
                '}';
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public PageInfo<T> getPageInfo() {
        return pageInfo;
    }

    public void setPageInfo(PageInfo<T> pageInfo) {
        this.pageInfo = pageInfo;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public T getObj() {
        return obj;
    }

    public void setObj(T obj) {
        this.obj = obj;
    }
}
